package com.teaphy.readlist.listener;

import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author teaphy
 * @desc
 * @since 17:07
 */
@WebListener
public class RequestListener implements ServletRequestListener {

    @Override
    public void requestDestroyed(ServletRequestEvent sre) {
        // TODO Auto-generated method stub
        HttpServletRequest servletRequest = (HttpServletRequest) sre.getServletRequest();
        Map<String, String[]> parameterMap = servletRequest.getParameterMap();
        System.out.println("parameters: " + parameterMap);
        System.out.println("======requestDestroyed========");
    }

    @Override
    public void requestInitialized(ServletRequestEvent sre) {
        System.out.println("======requestInitialized========");
    }
}